@extends('layouts.appDomain')

@section('content')
<div class="container py-5">
    <div class="row justify-content-center">
        <div class="col-12">
			<div class="text-right mb-2"><a href="/user/recharge">充值</a> <a href="/user/moneyLog">记录</a></div>
        	<h4 class="text-center mb-2">积分记录</h4>
        	<form class="form-inline" action="/user/moneyLog" method="get">
				<select class="custom-select my-1 mr-sm-2 ml-auto" id="trade_type" name="trade_type">
					<option value="">交易类型</option>
					<option value="1" {{(isset($trade_type) && $trade_type == 1) ? 'selected' :''}}>收入</option>
					<option value="2" {{(isset($trade_type) && $trade_type == 2) ? 'selected':''}}>支出</option>
				</select>
				<button class="btn btn-primary" type="submit">搜索</button>
        	</form>
        	<table class="table text-nowrap">
				<thead class="thead-light">
				    <tr>
					    <th scope="col">序号</th>
					    <th scope="col">订单号</th>
					    <!-- <th scope="col">玩家</th> -->
					    <th scope="col">类型</th>
					    <th scope="col">数额</th>
					    <th scope="col">交易类型</th>
					    <th scope="col">时间</th>
				    </tr>
			    </thead>
			    <tbody>
			    	@foreach($list as $item)
					<tr>
						<td scope="row">{{$loop->iteration}}</td>
						<td>{{$item->order_no}}</td>
						<!-- <td>{{$item->player_id ? $item->getPlayerData()->username : ''}}</td> -->
						<td>{{config('conf.player_money_type.'.$item->type)}}</td>
						<td>{{$item->amount}}</td>
						<td>
							{{ $item->trade_type == 1 ? '收入' : '支出' }}
						</td>
						<td>{{$item->created_at}}</td>
				    </tr>
				    @endforeach
			    </tbody>
			</table>
			<div class="m-t-20">
		        <ul class="pagination pagination-primary justify-content-center">
		            {{$list->links()}}
		        </ul>
		    </div>
        </div>
    </div>
</div>
@endsection
